package main

import "fmt"

func main() {

	slice := []int{}

	//如果超过容量以2倍扩容,容量为1000扩容1.25
	//s1 := append(slice,11,12)

	var ocap int
	var ncap int

	for i := 0; i <= 10010; i++ {
		ocap = cap(slice)
		slice = append(slice, i)
		ncap = cap(slice)
		if ncap > ocap && true {

			fmt.Println(ocap, ncap, float32(ncap)/float32(ocap))

			ocap = ncap
		}
	}

	slice1 := make([]int, 0, 10000)

	copy(slice1, slice)

	fmt.Println(slice)
	fmt.Println(slice1, cap(slice1))

}
